<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

  <script>
    'use strict';

    var c = 888;
    var old_alert = window.alert;
    alert(c);
    alert(window.c); //所有全局变量，都会绑定window对象下
    window.alert = function (){
    };
    // alert失效了
    alert("xxxxxxxxxxxxxxxxxxx");
    window.alert = old_alert;
    alert("我又复活了！");
    function zjz(){
      var x = 1;
      x = x + 1;
      function zjz2(){
        var x = 'A';
        console.log("inner:"+ x);  // inner:A
      }
      zjz2()
      console.log("outer:" + x); // outer:2
    }
    // x = x + 2; // Uncaught ReferenceError: x is not defined


   /* function zjz(){
      var x = "x" + y;  // xundefined
      console.log(x);
      var y = 'y';
    }*/



  </script>
</head>
<body>

</body>
</html>